<include file="public@header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:url('index')}">生产列表</a></li>
			<li class="active"><a href="">编辑</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form margin-top-20" action="">
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>公司名称</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-name" required name="name" value="{$result.name}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-mid" class="col-sm-2 control-label">原材料选择</label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" value="{$result.material_name}"
						   placeholder="请选择原材料" onclick="doSelectLayer(this,material);" data-has_null="true"
						   data-url="{:url('material/check',['pid'=>$result['id']])}" data-id="input-mid" name="layer_temp[1]"
						   readonly/>
					<input class="form-control" type="hidden" value="{$result.material_ids}" name="mid"
						   id="input-mid"/>
				</div>
			</div>
			<div class="form-group">
				<label for="input-mcost" class="col-sm-2 control-label">原材料</label>
				<div class="col-md-6 col-sm-10">
					<input type="number" class="form-control" id="input-mcost" name="mcost" readonly value="{$result.material}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">辅助材料</label>
				<div class="col-md-6 col-sm-10">
					<volist name="types" id="vo">
						<eq name="vo.cid" value="3">
							<div class="input-group">
								<div class="input-group-addon">{$vo.name}</div>
								<input type="number" class="form-control" name="cost[3][{$vo.id}]" value="{$vo.cost}">
							</div>
						</eq>
					</volist>
				</div>
			</div>
			<div class="form-group">
				<label for="input-manpower" class="col-sm-2 control-label">人工</label>
				<div class="col-md-6 col-sm-10">
					<input type="number" class="form-control" id="input-manpower" name="manpower" value="{$result.manpower}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-apportion" class="col-sm-2 control-label">公摊</label>
				<div class="col-md-6 col-sm-10">
					<input type="number" class="form-control" id="input-apportion" name="apportion" value="{$result.apportion}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-reg_time" class="col-sm-2 control-label"><span class="form-required">*</span>注册时间</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control js-bootstrap-date" id="input-reg_time" required name="reg_time" value="{$result.reg_time|date='Y-m-d',###}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-end_time" class="col-sm-2 control-label"><span class="form-required">*</span>到期时间</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control js-bootstrap-date" id="input-end_time" required name="end_time" value="{$result.end_time|date='Y-m-d',###}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-corporation" class="col-sm-2 control-label"><span class="form-required">*</span>法人</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-corporation" required name="corporation" value="{$result.corporation}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-supervisor" class="col-sm-2 control-label"><span class="form-required">*</span>监事</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-supervisor" required name="supervisor" value="{$result.supervisor}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-director" class="col-sm-2 control-label"><span class="form-required">*</span>董事</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-director" required name="director" value="{$result.director}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-accountant" class="col-sm-2 control-label"><span class="form-required">*</span>财务/办税人员</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-accountant" required name="accountant" value="{$result.accountant}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-area" class="col-sm-2 control-label"><span class="form-required">*</span>注册地</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-area" required name="area" value="{$result.area}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-registered_capital" class="col-sm-2 control-label"><span class="form-required">*</span>注册资金</label>
				<div class="col-md-6 col-sm-10">
					<input type="number" class="form-control" id="input-registered_capital" required name="registered_capital" value="{$result.registered_capital}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-reg_type" class="col-sm-2 control-label"><span class="form-required">*</span>注册类型</label>
				<div class="col-md-6 col-sm-10">
					<label class="radio-inline">
						<input type="radio" name="reg_type" id="input-reg_type1" value="1" <eq name="result.reg_type" value="1">checked</eq> > 内资
					</label>
					<label class="radio-inline">
						<input type="radio" name="reg_type" id="input-reg_type2" value="2" <eq name="result.reg_type" value="2">checked</eq> > 外资
					</label>
					<label class="radio-inline">
						<input type="radio" name="reg_type" id="input-reg_type3" value="3" <eq name="result.reg_type" value="3">checked</eq> > 合资
					</label>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-primary js-ajax-submit">保存</button>
					<a class="btn btn-default" href="javascript:history.back(-1);">返回</a>
				</div>
			</div>
		</form>
	</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
	function material(data) {
		console.log(data);
        $('#input-mcost').val(data.cost);
	}
</script>
</body>
</html>